Skip to content

Implement match and match cycle repos - #74

Open
rootandroo wants to merge 2 commits into
alter-match-schemafrom
api-match-repos
Open

Implement match and match cycle repos#74
rootandroo wants to merge 2 commits into
alter-match-schemafrom
api-match-repos

Conversation

@rootandroo

Copy link
Copy Markdown
Contributor

No description provided.

rootandroo commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@rootandroo
rootandroo force-pushed the api-match-repos branch 3 times, most recently from 5470d2c to dbbd19b Compare August 10, 2026 17:31
@rootandroo
rootandroo marked this pull request as ready for review August 10, 2026 17:34
@rootandroo
rootandroo requested a review from a team August 10, 2026 17:34
@graphite-app

graphite-app Bot commented Aug 10, 2026

Copy link
Copy Markdown

Graphite Automations

"Request reviewers once CI passes" took an action on this PR • (08/10/26)

2 reviewers were added to this PR based on Henry Chen's automation.

@rootandroo
rootandroo requested a review from spiffyy99 August 10, 2026 18:54
@spiffyy99

Copy link
Copy Markdown

Code looks good, although I wonder if the match cycle repo could use some per-field update methods like match has.

Also, we planning on writing any tests for these? Not sure if there's another ticket for them

@rootandroo
rootandroo changed the base branch from main to graphite-base/74 August 14, 2026 19:30
@rootandroo
rootandroo changed the base branch from graphite-base/74 to remove-unmatched-ids August 14, 2026 19:30

Copy link
Copy Markdown
Contributor Author

Code looks good, although I wonder if the match cycle repo could use some per-field update methods like match has.

Also, we planning on writing any tests for these? Not sure if there's another ticket for them

​thanks for the feedback il include tests in the next PR. Will update this one with the per field methods

@rootandroo
rootandroo changed the base branch from remove-unmatched-ids to graphite-base/74 August 14, 2026 20:59
@graphite-app
graphite-app Bot changed the base branch from graphite-base/74 to main August 14, 2026 21:00

arklian commented Aug 14, 2026

Copy link
Copy Markdown
Member

One other thing is that you're building out everything together layer by layer, which makes sense with how we planned it out and with AI implementing it, but it would be easier to build it out feature by feature once we get it to a little more stable state.

Like having the basics set, and then adding filtering and feedback later down, instead of including it from the start.

Comment thread src/main/java/org/patinanetwork/patchats/api/match/db/repos/MatchSqlRepo.java Outdated
@rootandroo
rootandroo changed the base branch from main to graphite-base/74 August 17, 2026 17:30
@rootandroo
rootandroo changed the base branch from graphite-base/74 to alter-match-schema August 17, 2026 17:53
@sonarqubecloud

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

@sonarqubecloud

Copy link
Copy Markdown

@rootandroo rootandroo changed the title Implement SQL Repos Implement match and match cycle repos Aug 19, 2026
}

@Override
public Optional<MatchCycle> setMatchCycleDraft(Integer id, boolean isDraft) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: better titled as setMatchCycleIsDraft, this way it's clearer that it's a Boolean switch.

public MatchCycle createMatchCycle(MatchCycle matchCycle) {
String sql = """
INSERT INTO "match_cycles" (
"period",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Postgres has range types we can use to do range searches, that would probably be a better type fit for this field. This would probably be more effective than shoehorning the range into a single format. Unsure how much we'll need that in the future though.

.optional();
}

@Override

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the discussions we had about the API, since a lot of these matches might be marked as bad by Henry in the beginning especially, may be good to have an update score function here. (I.e. so Henry can mark it as -100 or whatever)

String sql = """
INSERT INTO "matches" (
"id",
"member_a_id",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few thoughts here:

  • would we benefit from including member emails so the queries would be simpler? I'm assuming member ids are not indexed right now so it probably wouldn't make a difference performance wise. We could also include both in the table
  • We should have some kind of unique constraint or at least index on the pairing of member an and b's ids/emails. So we can easily look up "have a and b matched before? Or have b and a matched before"? Because that would be an instantly disqualifying factor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants